﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>RTX</title>
<script src="theme/js/jquery.js" type="text/javascript"></script>
<script language="javascript" runat="server">
var rtxXML = ""
rtxXML = rtxXML + '<?xml version="1.0" encoding="utf-8"?>'
rtxXML = rtxXML + '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
rtxXML = rtxXML + '<soap:Body>'
rtxXML = rtxXML + '<SendRTX xmlns="http://ws.oa.com/common/message">'
rtxXML = rtxXML + '<sender>cheunglong</sender>'
rtxXML = rtxXML + '<receiver>cheunglong,shenfeili</receiver>'
rtxXML = rtxXML + '<title>抽烟抽烟</title>'
rtxXML = rtxXML + '<msgInfo>该死的烟鬼，您好！龙翔邀请你抽根烟！</msgInfo>'
rtxXML = rtxXML + '<messageType>0</messageType>'
rtxXML = rtxXML + '</SendRTX>'
rtxXML = rtxXML + '</soap:Body>'
rtxXML = rtxXML + '</soap:Envelope>'
</script>
</head>
<%
set docRequest=Server.CreateObject("MSXML2.DOMDocument") 
docRequest.loadXML(rtxXML)

url = "http://ws.oa.com/messageservice.asmx"


'url编码，只替换默认的字符串
	Public Function UrlEncode(ByVal urlstr)
		urlstr = Replace(urlstr, "+", "%2B")
		urlstr = Replace(urlstr, " ", "+")
		urlstr = Replace(urlstr, "=", "%3D")
		urlstr = Replace(urlstr, "&", "%26")
		urlstr = Replace(urlstr, ":", "%3A")
		urlstr = Replace(urlstr, "/", "%2F")
		UrlEncode = urlstr
	End Function
'请求url,获取请求内容
	Public Function RequestUrl(url)
		Set XmlObj = Server.CreateObject("Microsoft.XMLHTTP")
		XmlObj.open "POST", url, False
		XmlObj.setRequestHeader "content-type","text/xml; charset=utf-8"
		XmlObj.setRequestHeader "SOAPAction","http://ws.oa.com/common/message/SendRTX"
		XmlObj.send(rtxXML)
		RequestUrl = XmlObj.responseText
		Set XmlObj = nothing
	End Function

%>
<body>
<div class="color">
	<button>发送RTX消息</button>
	<pre><%=RequestUrl(url)%></pre>
</div>
</body>
</html>
